local linchao = fk.CreateSkill{
    name = "ym2__linchao",
}
Fk:loadTranslationTable{
    ["ym2__linchao"] = "临朝",
    [":ym2__linchao"] = "一号位的出牌阶段结束时，其或你可以重置你与其的技能，然后弃置一张牌。",
    ["#ym2__linchao"] = "临朝：你可以重置邓绥与你的所有技能，然后弃置一张牌",
    ["#ym2__linchao-discard"] = "临朝：弃置一张牌",

    ["$ym2__linchao1"] = "尧舜之世，修德而后伐叛，民心安则天灾弥。",
    ["$ym2__linchao2"] = "皇帝幼冲，承统鸿业，朕且权佐助听政。",
}
linchao:addEffect(fk.EventPhaseEnd,{
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(linchao.name) and target and target.seat == 1 and target.phase == Player.Play
    end,
    on_cost = function (self, event, target, player, data)
        local room = player.room
        if room:askToSkillInvoke(target,{
            skill_name = linchao.name,
            prompt = "#ym2__linchao"
        }) then
            self.cost_data = target.id
            event:setCostData(self,target.id)
            return true
        end
        if target.id ~= player.id then
            if room:askToSkillInvoke(player,{
                skill_name = linchao.name,
                prompt = "#ym2__linchao"
            }) then
                event:setCostData(self,player.id)
                return true
            end
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local tos = {}
        table.insertIfNeed(tos,player.id)
        table.insertIfNeed(tos,target.id)
        for _, id in ipairs(tos) do
            local cp = room:getPlayerById(id)
            for _, skill in ipairs(cp:getAllSkills()) do
                if skill:isPlayerSkill(cp) then
                    if cp:usedSkillTimes(skill.name,Player.HistoryGame) > 0 then
                        cp:setSkillUseHistory(skill.name,0,Player.HistoryGame)
                    end
                    if cp:usedSkillTimes(skill.name,Player.HistoryRound) > 0 then
                        cp:setSkillUseHistory(skill.name,0,Player.HistoryRound)
                    end
                    if cp:usedSkillTimes(skill.name,Player.HistoryTurn) > 0 then
                        cp:setSkillUseHistory(skill.name,0,Player.HistoryTurn)
                    end
                    if cp:usedSkillTimes(skill.name,Player.HistoryPhase) > 0 then
                        cp:setSkillUseHistory(skill.name,0,Player.HistoryPhase)
                    end
                    room:validateSkill(cp, skill.name, "-round")
                    room:validateSkill(cp, skill.name, "-turn")
                    room:validateSkill(cp, skill.name, "-phase")
                end
            end
        end
        local tp = room:getPlayerById(event:getCostData(self))
        if not tp:isNude() then
            room:askToDiscard(tp,{
                max_num = 1,
                min_num = 1,
                include_equip = true,
                skill_name = linchao.name,
                cancelable = false,
                pattern = ".",
                prompt = "#ym2__linchao-discard"
            })
        end
    end,
})
return linchao